<template>
  <div>
    <h1>Child</h1>
  </div>
</template>

<script setup>
import { onBeforeMount, onBeforeUnmount, onMounted, onUnmounted } from 'vue';

// onBeforeMount(() => {
//   console.log('child - onBeforeMount')
// })
// onMounted(() => {
//   console.log('child - onMounted')
// })

// 组件要消失的时候执行，如果隐藏的话不会执行
onBeforeUnmount(() => {
  console.log('卸载前 - onBeforeUnmount')
})
onUnmounted(() => {
  console.log('卸载后 - onUnmounted')
})
</script>

<style lang="css" scoped>

</style>